package com.gs.cd.model.resource;

import com.baomidou.mybatisplus.annotation.IdType;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;
import java.util.List;

import com.diboot.core.binding.annotation.BindEntityList;
import com.gs.cd.eum.CategoryEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 *
 * </p>
 *
 * @author seven
 * @since 2020-12-22
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class SysResource implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private String id;

    private String parentId;

    /**
     * 资源名称
     */
    private String name;

    /**
     * 权限标识编码(全局唯一)
     */
    private String perms;

    /**
     * 前端-url
     */
    private String frontUrl;

    /**
     * 后端-url
     */
    private String backUrl;

    /**
     * （菜单M，菜单链接L,操作按钮O）
     */
    private String resourceType;

    private Integer sort;

    /**
     * 创建人
     */
    private String creator;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新人
     */
    private String updator;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 图标前端class
     */
    private String iconClass;

    /**
     * 颜色
     */
    private String iconColor;

    /**
     * 资源分类{系统后台system，项目后台project_manage，业务biz}
     */
    private CategoryEnum category;

    private String productId;

    @TableField(exist = false)

    @BindEntityList(entity = SysResource.class, condition = "this.id=parentId"
            , deepBind = true,orderBy="sort")
    private List<SysResource> childResource;

}
